package lx.springBoot.controller;

import common.Result;
import lx.springBoot.activeMq.Producer;
import lx.springBoot.entry.User;
import lx.springBoot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;


/**
 * Created by lx on 2017/7/3.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getUser")
    public @ResponseBody Result getUser(User user){
        return userService.getUser(user);
    }

    @RequestMapping("/test")
    public @ResponseBody Result getTest(Long id){
        return userService.getById(id);
    }

    @RequestMapping("/login")
    public @ResponseBody Result<User> login(String loginName,String pwd){
        return userService.login(loginName,pwd);
    }
}
